﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Principal;
using System.Text;
using System.Threading.Tasks;
using Sharp.DataTransferObject;
using Sharp.Portal;
using Sharp.Portal.Owin;


// ReSharper disable once CheckNamespace
namespace Microsoft.AspNet.Identity
{
    public static class IdentityExtensions
    {
        /// <summary>
        /// UserId
        /// </summary>
        /// <param name="identity"></param>
        /// <returns></returns>
        public static int GetId(this IIdentity identity)
        {
            return SharpUserManager.Current.Id;
        }
        /// <summary>
        /// UserId
        /// </summary>
        /// <param name="identity"></param>
        /// <returns></returns>
        public static List<PermissionDTO> GetPermissions(this IIdentity identity)
        {
            return SharpUserManager.Current.Permissions;
        }
    }
}
